package com.example.factory;

import com.example.factroy.DaggerFactory;
import com.example.factroy.GunFactory;
import com.example.factroy.Weapon;
import com.example.factroy.WeaponFactory;

/**
 * ClassName:testFactory
 * Package:com.example.factory
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/8-20:54
 * @Version:v1.0
 */
public class testFactory {
    public static void main(String[] args) {

        WeaponFactory weaponFactory1 = new GunFactory();
        Weapon gun = weaponFactory1.get();
        gun.attack();

        WeaponFactory weaponFactory2 = new DaggerFactory();
        Weapon dagger = weaponFactory2.get();
        dagger.attack();

    }
}
